package org.fjsei.yewu;

import org.fjsei.yewu.resolver.TusFileUploadResolver;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

/**
 * @desc
 * @created 2021/11/19 2:45 下午
 **/
@RestController
@RequestMapping("/upload")
@SpringBootApplication
public class TusApplication {

    @Resource
    private TusFileUploadResolver tusFileUploadResolver;
    //调试的=直接启动整个后端啊！ 报错:Web server failed to start. Port 8673 was already in use.
    public static void main(String[] args) {
        SpringApplication.run(TusApplication.class, args);
    }


//    @RequestMapping(value = {"/", "/**"}, method = {RequestMethod.POST})
//    public void uplaod1(HttpServletRequest request, HttpServletResponse response) {
//        tusFileUploadResolver.upload(request, response);
//    }
//    @RequestMapping(value = {"/", "/**"}, method = {RequestMethod.PATCH})
//    public void uplaod2(HttpServletRequest request, HttpServletResponse response) {
//        tusFileUploadResolver.upload(request, response);
//    }
//    @RequestMapping(value = {"/", "/**"}, method = {RequestMethod.HEAD})
//    public void uplaod3(HttpServletRequest request, HttpServletResponse response) {
//        tusFileUploadResolver.upload(request, response);
//    }
//    @RequestMapping(value = {"/", "/**"}, method = {RequestMethod.DELETE})
//    public void uplaod4(HttpServletRequest request, HttpServletResponse response) {
//        tusFileUploadResolver.upload(request, response);
//    }
//    @RequestMapping(value = {"/", "/**"}, method = {RequestMethod.GET})
//    public void uplaod5(HttpServletRequest request, HttpServletResponse response) {
//        tusFileUploadResolver.upload(request, response);
//    }
}

